#include "vzbase/base/loggingsettings.h"
#include "remote/server/server.h"

int main(int argc, char *argv[]) {

  vzbase::InitLoggingSystem(argc, argv);

  remote::RemoteServerSettings settings;

  settings.control_addr_ = remote::DEFAULT_SERVER_ADDR;
  settings.control_port_ = remote::DEFAULT_SERVER_PORT;

  boost::asio::io_service io_service;

  remote::RemoteServer::Ptr server(new remote::RemoteServer(io_service));
  server->StartRemoteServer(settings);
  while (true) {
    try {
      io_service.run();
    } catch(std::exception &e) {
      LOG(ERROR) << e.what();
    }
  }

  return EXIT_SUCCESS;
}